//
//  COUserIntegralCell.m
//  MJApp
//
//  Created by John on 15/3/30.
//  Copyright (c) 2015年 wangliang. All rights reserved.
//
#import "COUserIntegralCell.h"

@interface COUserIntegralCell ()

@property (weak, nonatomic) IBOutlet UIButton *selectBtn;
@property (weak, nonatomic) IBOutlet UILabel *integrateLabel;

@end

@implementation COUserIntegralCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)chosejifen:(UIButton *)sender {
    sender.selected = !sender.selected;
}

+ (instancetype)cellForTableview:(UITableView *)tableview{

    static NSString * ID = @"COUserIntegralCell";
    COUserIntegralCell * cell = [tableview dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[NSBundle mainBundle] loadNibNamed:ID owner:nil options:nil].lastObject;
    }
    cell.cellH = 60;
    return cell;
}

- (void)setInfoDic:(NSDictionary *)infoDic {
    
    [super setInfoDic:infoDic];
    NSInteger integ = [infoDic[@"integ"] integerValue];
    self.integrateLabel.text = [NSString stringWithFormat:@"现有积分%ld",integ];
    if (integ == 0) {
        
        self.selectBtn.userInteractionEnabled = NO;
    }else {
        
        self.selectBtn.userInteractionEnabled = YES;
    }
    
}

@end
